﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
   
    public partial class Form1 : Form
    {
        String name = "";
        public Form1()
        {
            
            InitializeComponent();
            name = this.tabControl1.SelectedTab.Name;
        }


        private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
        {
            TabControl temp = (TabControl)sender;
            MessageBox.Show("You changed the current tab to " + temp.SelectedTab.Name + " from " + name);
            name = temp.SelectedTab.Name;
        }
    }
}
